<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script>
        var num = 20;
        console.log(num);

        function fun(count) {
            count += 1;
            console.log(count);
        }
        fun(num);
        console.log(num);

        var obj = {
            name: '老周'
        }
        console.log(obj.name);

        function funObj(item) {
            item.name = '老曾';
            console.log(item.name);
        }

        funObj(obj);
        console.log(obj.name);


        //案例1
        var arr = [1, 2, 3];
        var arr2 = arr;
        console.log(arr, arr2);
        function funArr(nums) {
            nums.push(4);
            console.log(nums);
        }

        funArr(arr2);
        console.log(arr, arr2);

        arr2 = [1, 2, 3];
        console.log(arr, arr2);

    </script>
</body>

</html>